package decorator;

/**
 * @author dongtao
 * @desc 具体装饰器2
 * @Data 2021-08-15
 */
public class ConcreteDecorator2 extends Decorator {
    private String description = "加了摩卡";
    private Component component = null;
    
    public ConcreteDecorator2(Component component) {
        this.component = component;
    }
    
    @Override
    public String getDescription() {
        return component.getDescription() + "\n" + description;
    }
    
    @Override
    public double getPrice() {
        return component.getPrice() + 3;
    }
}
